<?php

/**
 * This is the model class for table "cron_load_data".
 *
 * The followings are the available columns in table 'cron_load_data':
 * @property string $id_cron_load_data
 * @property string $cron_name
 * @property string $whm_server_loadavg_one
 * @property string $whm_server_loadavg_five
 * @property string $whm_server_loadavg_fifteen
 * @property integer $id_account
 * @property string $time_date
 */
class CronLoadData extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @param string $className active record class name.
	 * @return CronLoadData the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'cron_load_data';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('id_account', 'numerical', 'integerOnly'=>true),
			array('cron_name', 'length', 'max'=>100),
			array('whm_server_loadavg_one, whm_server_loadavg_five, whm_server_loadavg_fifteen', 'length', 'max'=>10),
			array('time_date', 'safe'),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('id_cron_load_data, cron_name, whm_server_loadavg_one, whm_server_loadavg_five, whm_server_loadavg_fifteen, id_account, time_date', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'id_cron_load_data' => 'Id Cron Load Data',
			'cron_name' => 'Cron Name',
			'whm_server_loadavg_one' => 'Whm Server Loadavg One',
			'whm_server_loadavg_five' => 'Whm Server Loadavg Five',
			'whm_server_loadavg_fifteen' => 'Whm Server Loadavg Fifteen',
			'id_account' => 'Id Account',
			'time_date' => 'Time Date',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('id_cron_load_data',$this->id_cron_load_data,true);
		$criteria->compare('cron_name',$this->cron_name,true);
		$criteria->compare('whm_server_loadavg_one',$this->whm_server_loadavg_one,true);
		$criteria->compare('whm_server_loadavg_five',$this->whm_server_loadavg_five,true);
		$criteria->compare('whm_server_loadavg_fifteen',$this->whm_server_loadavg_fifteen,true);
		$criteria->compare('id_account',$this->id_account);
		$criteria->compare('time_date',$this->time_date,true);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}